﻿using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.Utils.UC;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.dataTable
{
    public partial class FormDataTableQueryConfig : DevExpress.XtraEditors.XtraForm
    {
        private List<DataTableQueryConfigDao> dataTableQueryConfigDaos = new List<DataTableQueryConfigDao>();
        public FormDataTableQueryConfig()
        {
            InitializeComponent();
            this.dataTableQueryConfigDaos = DataTableService.getDataTableQueryConfigByType("ipqc");
            this.gridControl查询结构.DataSource = this.dataTableQueryConfigDaos;
            this.gridView查询结构.RefreshData();
        }

        private void 显示数据ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String id = this.gridView查询结构.GetRowCellValue(this.gridView查询结构.FocusedRowHandle, "id").ToString();
            foreach (DataTableQueryConfigDao item in this.dataTableQueryConfigDaos)
            {
                if (id.Equals(item.id))
                {
                    new FormDataTable(item).ShowDialog();
                    break;
                }
            }
        }
    }
}